<%@page import="com.ksyzt.ksite2.shared.modle.WATER_INFOObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.WATER_INFOObjs"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.impl.WATER_INFODAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.IWATER_INFODAO"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.impl.NEWSDAOImpl"%>
<%@page import="com.ksyzt.ksite2.server.database.dao.INEWSDAO"%>
<%@page import="com.ksyzt.ksite2.server.common.PageNaviData"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObj"%>
<%@page import="com.ksyzt.ksite2.shared.modle.VW_NEWSObjs"%>
<%@page import="com.ksyzt.ksite2.client.column.ColumnType"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObjs"%>
<%@page import="com.ksyzt.ksite2.shared.modle.COLUMNObj"%>
<%@page import="com.ksyzt.ksite2.shared.PageData"%>
<%@page import="com.ksyzt.ksite2.server.common.Application"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
	+ request.getServerName() + ":" + request.getServerPort()
	+ path + "/";
	Application app=new Application(request,response);
	PageData pd=app.getApplicationPageData();
	IWATER_INFODAO dao=new WATER_INFODAOImpl(Application.getConnection());
	long count=dao.getCountByWhereTemplate("");
	long currentpage=app.parameterAsLong("page", 0l);
	long pagesize=app.parameterAsLong("pagesize",20l);
	
	PageNaviData navidata=new PageNaviData("news/water.jsp?",count,pagesize,currentpage);
	int start=(int)(currentpage*pagesize);
	int end =start+(int)pagesize;
	WATER_INFOObjs infos=dao.getSpecificRecordByWhereTemplate("order by updatetime desc",start,end);
	
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=pd.getName()%>-水情信息</title>
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="keywords" content="<%=pd.getKeyWords()%>" />
<meta http-equiv="description" content="<%=pd.getSummary()%>" />
<link rel="stylesheet" type="text/css" href="css/comm.css" />
<style type="text/css">
.w_970
{
	clear: both;
	float: none;
}
.newslist {
	width: 950px;
	
}
.newslist table{
	clear:both;
	font-size:13px;
	background-color: skyblue;
	margin-top: 5px;
	float: none;
}
.newslist table tr
{
	background-color: white;
}
.newslist table tr td
{
	text-align: center;
	vertical-align: middle;
}
.newslist table tr:first-child
{
	background-image: url("images/table_head_back.png");
	background-repeat: repeat-x;
	font-weight: bold;
}

.newslist-top {
	
	width: 100%;
	border: 1px solid #a8ccee;
	float: left;
	background: url(images/block_top_back.png) no-repeat;
	height: 32px;
	margin: 10px 0px 10px 0px;
}

.newslist-top-title {
	line-height: 34px;
	padding: 0px 0px 0px 18px;
	font-size: 14px;
	font-family: 宋体;
	font-weight: bold;
	color: white;
}

.newslist-top-more {
	display: none;
	float: right;
	margin: 5px 6px 0px 0px;
	width: 41px;
	height: 17px;
}

.newslist-top-more-link {
	text-decoration: none;
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more1.gif) no-repeat;
}

.newslist-top-more-link:hover {
	width: 41px;
	height: 17px;
	display: block;
	background: url(images/more2.gif) no-repeat;
}

.newslist-top-tabs {
	border-top: solid 1px #9cd9f5;
	margin: 0px;
	padding: 0px;
	display: block;
}

.newslist-top-tabs ul {
	width: 100%;
	border-top: solid 1px #9cd9f5;
	margin: 0px;
}

.newslist-top-tabs .unselected {
	overflow: hidden;
	color: #505050;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_normal.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 1px #a8ccee;
	border-left: solid 1px #a8ccee;
	border-collapse: separate;
	font-size: 12px;
	font-family: 宋体;
}

.newslist-top-tabs .selected {
	overflow: hidden;
	color: darkblue;
	font-weight: bold;
	text-decoration: none;
	height: 26px;
	line-height: 26px;
	background: url(images/480_box_select.gif) repeat-x;
	list-style: none;
	float: left;
	padding: 0px 2px 0px 2px;
	width: 115px;
	text-align: center;
	vertical-align: middle;
	cursor: pointer;
	border-bottom: solid 0px #9cd9f5;
	border-left: solid 1px #9cd9f5;
	font-size: 12px;
	font-family: 宋体;
}

.newslist-content {
	width: 100%;
}

.newslist-content-tab ul {
	margin: 5px 0px 0px 0px;
	padding: 0px;
}

.newslist-content-tab li {
	line-height: 200%;
	height: 30px;
	border-top: dashed 1px #505050;
	font-size: 12px;
	font-family: 宋体;
	list-style: none;
	padding: 0px 0px 0px 22px;
	background: url(images/item_indicator.png) 6px 9px no-repeat;
}

.newslist-content-tab a {
	width: 635px;
	text-decoration: none;
	color: #333;
	float: left;
	line-height: 30px;
	display: block;
	height: 30px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 12px;
	font-family: 宋体;
}

.newslist-content-tab .text {
	text-align: center;
	line-height: 26px;
	margin: 6px auto;
	font-size: 14px;
}

.newslist-content-tab a:hover {
	color: #014b90;
	background-color: #f0f0f0;
}

.newslist-content-tab span {
	font-size: 12px;
	float: left;
	width: 60px;
	display: block;
}

.newslist-content-tab li:FIRST-CHILD {
	border-top: solid 0px skyblue;
}

.pn {
	width: 970px;
}

.pn .navibar-middle {
	width: 950px;
}

.pagecontent {
	margin-left: 1px;
	padding: 5px;
}
</style>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.ksyzt.js"></script>
<script type="text/javascript">
	function load() {

		$(".stylish").makeStylish();

	}
	$(document).ready(load);
</script>
</head>

<body>
	<div class="wrap">
		<div class="wrap_center">
			<jsp:include page="../include/top.jsp" />

			<div class="w_970">
				<div class="pn">
					<div class='navibar-left'></div>
					<div class='navibar-middle'>
						<a href=''>首页</a>&nbsp;&gt;&nbsp;水情信息&nbsp;(数据来源:<a href='http://www.pearlwater.gov.cn/xxcx/syqxx/index.jsp' target="_blank">珠江水利网</a>)
						<form style="display: inline;" action="news/search.jsp"
							method="get">
							<table style="float:right;">
								<tr>
									<td><select name="type" class='search_select'>
											<option value="0" selected="selected">内容</option>
											<option value="1">标题</option>
									</select></td>
									<td><input name="w" type="text" value="" />
									</td>
									<td><input type="submit" value="搜索" />
									</td>
								</tr>
							</table>
						</form>

					</div>
					<div class='navibar-right'></div>
				</div>
					<div class='pagecontent'>

					<%
						if (count == 0) {
					%>
					<div class="message_box">对不起，我们正努力为您准备大藤峡的水情信息!</div>
					<%
						} else {
					%>
					<div class='newslist'>
						<div class='newslist-top'>
							
							<div class='newslist-top-title'>水情信息</div>
							</div>
						<table width="100%" cellpadding="6" cellspacing="1" >
							<tr>
								<td>
									站名
								</td>
								<td>
									所在河流
								</td>
								<td>
									水位
								</td>
								<td>
									警戒水位
								</td>
								<td>
									流量
								</td>
								<td>
									水势
								</td>
								<td>
									更新时间
								</td>
							</tr>
							<%
								for(WATER_INFOObj info:infos)
								{
									out.print("<tr>");
									out.print("<td>");
									out.print(info.getSTATION());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getRIVER());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getSTAGE());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getALERT_STAGE());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getFLUX());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getTREND());
									out.print("</td>");
									out.print("<td>");
									out.print(info.getUPDATETIME().toString().substring(0,19));
									out.print("</td>");
									out.print("</tr>");
								}
							%>
						</table>
					</div>
					
					<%
						}
					%>

					<!-- page navi -->
					<div class='news-navi'>

						<%
							out.print(app.toPagesNavigatorBar(navidata));
						%>
					</div>
				</div>

			</div>
		</div>
		<jsp:include page="../include/bottom.jsp" />
	</div>
</body>
</html>
